const {config,gulp,assetRev} = require("./gulp.config.js") ;
const {src,dest,series, parallel} = gulp;

const moveThird = async () =>{
	return src(config.srcPath + 'third/**/*')
	.pipe(dest(config.prdPath + 'third'))
}
const moveVideo = async () =>{
	return src(config.srcPath + 'video/**/*')
	.pipe(dest(config.prdPath + 'video'))
}

const moveJS = async () =>{
	return src(config.srcPath + 'js/**/*')
	.pipe(dest(config.prdPath + 'js'))
}
const moveImg = async () =>{
	return src(config.srcPath + 'images/**/*')
	.pipe(dest(config.prdPath + 'images'))
}
const moveFonts= async () =>{
	return src(config.srcPath + 'fonts/**/*')
	.pipe(dest(config.prdPath + 'fonts'))
}

const moveHtml = async () =>{
	console.log("HTML move start")
	return src(config.srcPath + '*.html')
	.pipe(assetRev())
	.pipe(dest(config.prdPath))
}

const moveCss = async () =>{
	return src(config.srcPath + 'css/*.min.css')
		.pipe(dest(config.prdPath + 'css'))
}

exports.build = series(moveHtml,moveVideo, parallel(moveThird,moveFonts, moveJS,moveCss),moveImg);

